import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

import javax.xml.crypto.Data;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Date;

/**
 * Created by MtRider on 2021/4/30 14:23
 */
public class test1 {
    public static void main(String[] args) {
        int [] nums={7,1,5,4};
        int i = maximumDifference(nums);
    }
    public static int maximumDifference(int[] nums) {
        int length=nums.length;
        int max=Integer.MIN_VALUE;
        int currentDiff;
        for(int i=0;i<length-1;i++){
            currentDiff=nums[i+1]-nums[i];
            if(currentDiff>max){
                max=currentDiff;
            }
        }
        return max;
    }
}
